#include "calc.h"
#define MAXVAL 1000
int sp = 0;
double stack[MAXVAL];

void push(double e) {
	if (sp >= MAXVAL) {
		printf("error,can't push %g\n", e);
		return;
	}
	stack[sp++] = e;
}
double pop() {
	if (sp > 0)
		return stack[--sp];
	else {
		printf("error,stack empty\n");
		return 0.0;
	}
}
